package cars;

public class Car extends Vehicle {

    private String model;
    //轿车的类型


    public Car(String model) {
        this.model = model;
    }

    //无参
    public Car(String type, String brand, String model, String vehicleID, double perRent) {
        super(type, brand, vehicleID, perRent);
        this.model = model;
    }

    //有参
    public String getModel() {
        return model;
    }
    //获得型号

    public void setModel(String model) {
        this.model = model;
    }

    //设置型号
    public double calRent(int day) {
        if (day > 150) {
            return 1.0 * getPerRent() * day * 0.7;
        } else if (day > 30) {
            return 1.0 * getPerRent() * day * 0.8;
        } else if (day > 7) {
            return 1.0 * getPerRent() * day * 0.9;
        } else {
            return 1.0 * getPerRent() * day;
        }
    }

    //计算租金
    @Override
    public String toString() {
        return getType() + " " + getBrand() + " " + model + " " + getVehicleID() + " " + getPerRent();
    }
    //返回汽车
}
